<?php

class AppController extends Controller {

    var $components = array('Auth','Acl','Email','Session','Captcha','RequestHandler', 'Openid' => array('accept_google_apps' => true));

	// function to make enums dropdown menu values
	function beforeRender() {
		foreach($this->modelNames as $model) {
			foreach($this->$model->_schema as $var => $field) {
				if(strpos($field['type'], 'enum') === FALSE){
					continue;
				}
				preg_match_all("/\'([^\']+)\'/", $field['type'], $strEnum);

				if(is_array($strEnum[1])) {
					$varName = Inflector::camelize(Inflector::pluralize($var));
					$varName[0] = strtolower($varName[0]);
					$this->set($varName, array_combine($strEnum[1], $strEnum[1]));
				}
			}
		}
	}

	function captcha() {

		$this->Captcha->show();

	}

}

?>
